--TransScene
--create by zouyb
--过渡场景， 切换语言时，先换到"过渡场景"，再切换回"游戏场景"

require "game/scene/SceneBase"
require "game/ui/form/login/UILogin"
require "game/ui/form/dungeon/UICommunicating"

local TransScene = class("TransScene",function()
    return SceneBase.new();
end)

function TransScene.create()
    local scene = TransScene.new();
    return scene;
end

function TransScene:ctor()
    -- 创建加载动画
    local uiComm = UICommunicating.create();
    self:addForm(uiComm); 
    
    -- 清理缓存
    UIMgr.clearUnusedTextures();
    
    -- 重新加载模块
    loadModules();

    local function enter()
        -- 回到主场景
        UIMgr.enterMain();

        -- 去掉加载动画
        self:removeFormByName("UICommunicating");
    end
    performWithDelay(self, enter, 1.0);   
end

return TransScene
